﻿@using HrEFCore.Models
@using HrEFCore
@model List<HrEFCore.Models.ERView2>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>My CSHTML 'position_release_search.cshtml' starting page</title>
    <link href="~/aa/element-ui/lib/theme-chalk/index.css" rel="stylesheet" />
    <script src="~/aa/vue/dist/vue.js"></script>
    <script src="~/aa/element-ui/lib/index.js"></script>
    <script src="~/javascript/jquery-1.7.2.js"></script>
    <script src="~/aa/axios/dist/axios.js"></script>
    <style type="text/css">
        body {
            background: rgb(253,244,227);
        }

        .TD_STYLE1 {
            background: #E6DDCE;
            /* color:white; */
        }

        .TD_STYLE2 {
            background: rgb(253,244,227);
        }

        .INPUT_STYLE2 {
            background: rgb(253,244,227);
        }
    </style>
</head>
<body>
    <div id="app">
        <table width="100%">
            <tr>
                <td>
                    <font color="black">
                        您正在做的业务是：人力资源--招聘管理--面试管理--面试结果登记--有效简历列表
                    </font>
                </td>
            </tr>
        </table>
        <el-table :data="erList" stripe style="width: 100%">
            <el-table-column prop="resId" label="档案编号"></el-table-column>
            <el-table-column prop="humanName" label="姓名"></el-table-column>
            <el-table-column prop="humanMajorKindName" label="职位分类"></el-table-column>
            <el-table-column prop="hunmaMajorName" label="职位名称"></el-table-column>
            <el-table-column prop="interviewAmount" label="面试次数"></el-table-column>
            <el-table-column prop="registeTime" label="面试时间">
                <template slot-scope="scope">
                    {{ formatDateTime(scope.row.registeTime) }}
                </template>
            </el-table-column>
            <el-table-column prop="multiQualityDegree" label="综合素质"></el-table-column>
            <el-table-column prop="mreId" label="筛选">
                <template slot-scope="scope">
                    <a :href="'/ER/InterviewSX?resId=' + scope.row.resId" target="mainFrame" style="color:black;">筛选</a>
                </template>
            </el-table-column>
        </el-table>

        <div id="pageDiv">
            <div id="rightPage">
                <el-pagination v-on:size-change="handleSizeChange" v-on:current-change="handleCurrentChange"
                               :current-page="currentPage" :page-sizes="[1, 2, 3, 4]" :page-size="pageSize"
                               layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
                </el-pagination>
            </div>
        </div>

    </div>

    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    erList: @Html.Raw(Json.Serialize(Model)), //将模型数据序列化为JSON格式
                    currentPage: @ViewData["CurrentPage"],
                    pageSize: @ViewData["PageSize"],
                    totalRows: @ViewData["TotalRows"],
                }
            },
            methods: {
                formatDateTime(dateTime) {
                    const date = new Date(dateTime);
                    const year = date.getFullYear();
                    const month = ("0" + (date.getMonth() + 1)).slice(-2);
                    const day = ("0" + date.getDate()).slice(-2);
                    const hours = ("0" + date.getHours()).slice(-2);
                    const minutes = ("0" + date.getMinutes()).slice(-2);
                    const seconds = ("0" + date.getSeconds()).slice(-2);
                    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
                },
                // 每页显示数改变
                handleSizeChange(val) {
                    this.pageSize = val;
                    this.fill();
                },
                // 当前页改变
                handleCurrentChange(val) {
                    this.currentPage = val;
                    this.fill();
                },
                fill() {
                    // 发起异步请求获取数据
                    axios.get('/ER/FYCX2', {
                        params: {
                            page: this.currentPage,
                            pageSize: this.pageSize // 传递当前页和每页显示数
                        }
                    })
                        .then(response => {
                            this.erList = response.data.erList; // 更新emrList
                            this.totalRows = response.data.totalRows; // 更新totalRows
                        })
                        .catch(error => {
                            console.error(error);
                        });
                }
            }
        })
    </script>
</body>
</html>